/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entities;

import interfaces.InternationalizableEntity;
import interfaces.InternationalizableEntityDescription;
import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author damfercer
 */
@Entity
@Table(name = "educational_status_description", catalog = "facetoframe", schema = "")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "EducationalStatusDescription.findAll", query = "SELECT e FROM EducationalStatusDescription e"),
    @NamedQuery(name = "EducationalStatusDescription.findByIdEducationalStatusDescription", query = "SELECT e FROM EducationalStatusDescription e WHERE e.idEducationalStatusDescription = :idEducationalStatusDescription"),
    @NamedQuery(name = "EducationalStatusDescription.findByDescription", query = "SELECT e FROM EducationalStatusDescription e WHERE e.description = :description")})
public class EducationalStatusDescription implements Serializable,InternationalizableEntityDescription {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "ID_EDUCATIONAL_STATUS_DESCRIPTION")
    private Integer idEducationalStatusDescription;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 40)
    @Column(name = "DESCRIPTION")
    private String description;
    @JoinColumn(name = "EDUCATIONAL_STATUS", referencedColumnName = "ID_EDUCATIONAL_STATUS")
    @ManyToOne(optional = false)
    private EducationalStatus educationalStatus;
    @JoinColumn(name = "LANGUAGE", referencedColumnName = "ID_LANGUAGE")
    @ManyToOne(optional = false)
    private Language language;

    public EducationalStatusDescription() {
    }

    public EducationalStatusDescription(Integer idEducationalStatusDescription) {
        this.idEducationalStatusDescription = idEducationalStatusDescription;
    }

    public EducationalStatusDescription(Integer idEducationalStatusDescription, String description) {
        this.idEducationalStatusDescription = idEducationalStatusDescription;
        this.description = description;
    }

    public Integer getIdEducationalStatusDescription() {
        return idEducationalStatusDescription;
    }

    public void setIdEducationalStatusDescription(Integer idEducationalStatusDescription) {
        this.idEducationalStatusDescription = idEducationalStatusDescription;
    }

    @Override
    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public EducationalStatus getEducationalStatus() {
        return educationalStatus;
    }

    public void setEducationalStatus(EducationalStatus educationalStatus) {
        this.educationalStatus = educationalStatus;
    }

    public Language getLanguage() {
        return language;
    }

    public void setLanguage(Language language) {
        this.language = language;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idEducationalStatusDescription != null ? idEducationalStatusDescription.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof EducationalStatusDescription)) {
            return false;
        }
        EducationalStatusDescription other = (EducationalStatusDescription) object;
        if ((this.idEducationalStatusDescription == null && other.idEducationalStatusDescription != null) || (this.idEducationalStatusDescription != null && !this.idEducationalStatusDescription.equals(other.idEducationalStatusDescription))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entities.EducationalStatusDescription[ idEducationalStatusDescription=" + idEducationalStatusDescription + " ]";
    }

    @Override
    public InternationalizableEntity getEntity() {
        return getEducationalStatus();
    }
    
}
